/**
 * Created by cherry
 */
import React, {Component} from 'react';
import {
    ToolbarAndroid,
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TextInput,
    Platform,
    TouchableOpacity
} from 'react-native';
import Svg from './Svg.js';
export default class LoginButton extends Component {
    constructor(props) {
        super(props);
        this.state = {text: ''};
    }

    render() {
        const {isSmall,bgColor,widths,tColor,isShowSvg,sIcon,sColor,name}=this.props;
        return (
            <TouchableOpacity onPress = {this.props.onPressCallback.bind(this)}
                              style = {[!isSmall ? LoginStyles.loginTextView : LoginStyles.loginSmallButton,
                                      {backgroundColor:bgColor,width:widths}]}>
                {isShowSvg && Platform!=='web' ? <Svg color={sColor} icon={sIcon} size="16"/> : null }
                <Text style = {[LoginStyles.loginText,{color:tColor || '#FFF'}]} > { name }</Text >
            </ TouchableOpacity >
         );
    }
}
const LoginStyles = StyleSheet.create({

    loginText: {
        fontSize:12
    },
    loginTextView: {
        flexDirection:"row",
        height: 35,
        justifyContent: 'center',
        alignItems: 'center',

    },
    loginSmallButton:{
        display:"flex",
        flexDirection:"row",
        paddingVertical:2,
        paddingHorizontal:12,
        marginRight:5,
        fontWeight:"normal",
        alignItems: 'center',
        textAlign:"center",
        fontSize:12,
        borderRadius:5

    }
});